import Vue from 'vue';
import Router from 'vue-router';

import Layout from '@/views/layout/Layout.vue';
import Dashboard from '@/views/dashboard/Dashboard.vue';
import Login from '@/views/login/Login.vue';

import dataModelRouters from './modules/dataModel';
import logManageRouters from '@/router/modules/logManage';
import dataGovernRouters from '@/router/modules/dataGovern';
import calcModelRouters from '@/router/modules/calcModel';
import statisticalStatementRouters from '@/router/modules/statisticalStatement';
import systemManageRouters from '@/router/modules/systemManage';

Vue.use(Router);

const baseRouter: any[] = [
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: 'dashboard',
        children: [
            {
                path: 'Dashboard',
                component: Dashboard,
                name: 'Dashboard'
            }
        ]
    },
    {
        path: '/Dashboard',
        component: Dashboard
    }
    ,
    {
        path: '/login',
        component: Login,
        name: 'login'
    }
];

export default new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: baseRouter.concat(dataModelRouters, logManageRouters, dataGovernRouters, calcModelRouters, statisticalStatementRouters, systemManageRouters),
});

